
local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script, CommonOHOH.files.BaseComponent());



function M.LoadHumanoidAnimation(model,rid,animationId)
	local Animator = model:WaitForChild("Humanoid"):WaitForChild("Animator")
    local animation = Instance.new("Animation",Animator)
    animation.AnimationId=rid
    animation.name=animationId
    return animation
end;

function M.PlayHumanoidAnimationById(model,animationId)
	local Humanoid=model:WaitForChild("Humanoid")
	local Animator = model:WaitForChild("Humanoid"):WaitForChild("Animator")
	local Animation=Animator:WaitForChild(animationId)
	assert(Animation,"Animation==nil")
	local animationTrack =Humanoid:LoadAnimation(Animation)
	animationTrack:Play()
end;

function M.PlayHumanoidAnimation(model,animation)
	local Humanoid=model:WaitForChild("Humanoid")
	local animationTrack =Humanoid:LoadAnimation(animation)
	animationTrack:Play()
end

return M